<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateStatRegLogTable extends Migration
{
    protected $connection = 'stat';

    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('stat_reg_log', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('stat_ts')->default(0)->comment('统计时间戳');
            $table->integer('reg_num')->default(0)->comment('周期内注册数');
            $table->integer('reg_male_num')->default(0)->comment('周期内注册男用户数');
            $table->integer('reg_female_num')->default(0)->comment('周期内注册女用户数');
            $table->timestamps();
            $table->tinyInteger('flag')->default(1)->comment('记录状态');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('stat_reg_log');
    }
}
